using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Shockwave : MonoBehaviour {


    private void Start()
    {
        StartCoroutine(WaitAndDestroy());
    }

    IEnumerator WaitAndDestroy()
    {
        yield return new WaitForEndOfFrame();
        Destroy(this.gameObject);
    }

    private void OnTriggerEnter(Collider other)
    {
        Ennemy e = other.GetComponent<Ennemy>();

        if(e == null)
            return;

        e.takeDamages(50);

    }
}
